<?php

function recuperarCategoria($param){
	global $cn;
	
	$colname__rs = '-1';
	if (isset($param)) {
	  $colname__rs = $param;
	}
	$query_rs = sprintf("SELECT ID_CATEGORIA FROM CATEGORIA WHERE NOMBRE_CATEGORIA = '%s'", $colname__rs);
	$rs = $cn->SelectLimit($query_rs) or die($cn->ErrorMsg());
	$totalRows_rs = $rs->RecordCount();
	
	$valor = $rs->Fields('ID_CATEGORIA');
	
	$rs->Close();
	
	return $valor;
	
}
?>